/**
 * 
 */
package japavo.gui.general_ui;

import japavo.gui.MainFrame;
import japavo.trainer.VocabularyTrainer;

import java.awt.event.ActionEvent;

import javax.swing.AbstractAction;
import javax.swing.BoxLayout;
import javax.swing.JButton;
import javax.swing.JPanel;

/**
 *
 */
@SuppressWarnings("serial")
public class StartPanel extends JPanel {
	
	private MainFrame mainFrame;
	private VocabularyTrainer trainer;

	/**
	 * 
	 */
	public StartPanel(MainFrame mainFrame, VocabularyTrainer trainer) {
		this.mainFrame = mainFrame;
		this.trainer = trainer;

		JButton startButton = new JButton("Start");
		startButton.addActionListener(new AbstractAction() {
			@Override
			public void actionPerformed(ActionEvent e) {
				StartPanel.this.mainFrame.startTraining();
			}
		});
		
		// set layout
		BoxLayout layout = new BoxLayout(this, BoxLayout.PAGE_AXIS);
		setLayout(layout);
		
		// add components
		add(startButton);
	}

}
